AMD/IOMMU: Delete iommu_{get,set,clear}_bit() helpers
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 2 Feb 2020 16:35:32 +0000 (16:35 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Feb 2020 16:10:23 +0000 (16:10 +0000)
commit127b5050e5fc5455e84589bcac25c5985795f009
treef9e7fd0f33ddd14451afff3bbcde2f6483613665
parent17d20e2ce648c2f0ac5784132f67a50ade7cc688
AMD/IOMMU: Delete iommu_{get,set,clear}_bit() helpers

These are obfuscations around simple bit operations, and the compiler really
can do a better job when it can see them normally:

  add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-189 (-189)
  Function                                     old     new   delta
  guest_iommu_add_ppr_log                      266     251     -15
  guest_iommu_add_event_log                    266     251     -15
  iommu_reset_log                              274     242     -32
  guest_iommu_process_command                 1602    1544     -58
  guest_iommu_mmio_write                      1123    1054     -69
  Total: Before=3019344, After=3019155, chg -0.01%

Drop all status register MASK/SHIFT constants, and enumerate the bits
normally.  Rename EVENT_OVERFLOW to EVENT_LOG_OVERFLOW for consistency.  (The
field name in the spec is inconsistent, despite the description referring to
an overflow of the event log.)

The only semantic change is in iommu_reset_log() where 'run_bit' changes from
being a bit position to being a single-bit mask.  Update some local variable
types to be more suitable.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/amd/iommu-defs.h
xen/drivers/passthrough/amd/iommu.h
xen/drivers/passthrough/amd/iommu_cmd.c
xen/drivers/passthrough/amd/iommu_guest.c
xen/drivers/passthrough/amd/iommu_init.c